// TypeScript file
class ResourceUtils
{
    public static createBitmapByName(name: string): egret.Bitmap
    {
        let ret: egret.Bitmap = new egret.Bitmap();
        let texture: egret.Texture = RES.getRes(name);
        ret.texture = texture;
        return ret;
    }

    public static createBitmapFromSheet(name: string, sheetName: string = "gameRes"): egret.Bitmap
    {
        let sheet: egret.SpriteSheet = RES.getRes(sheetName);
        let texture: egret.Texture = sheet.getTexture(name);
        let ret: egret.Bitmap = new egret.Bitmap();
        ret.texture = texture;
        return ret;
    }

    public static getTextureFromSheet(name: string, sheetName: string = "gameRes"): egret.Texture
    {
        let sheet: egret.SpriteSheet = RES.getRes(sheetName);
        let texture: egret.Texture = sheet.getTexture(name);
        return texture;
    }
}